package cn.java86.dao;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Arrays;

/**
 * @author oldliu
 * @since 1.0
 */
public class TestAop {
    public static void main(String[] args) {
        ApplicationContext context =new ClassPathXmlApplicationContext("aop.xml");
        UserDao dao = context.getBean(UserDao.class);
//        System.out.println(dao.getClass()+">>>>>>>");
//        System.out.println("父类:"+dao.getClass().getSuperclass());
//        System.out.println("实现的接口：");
//        Class<?>[] interfaces = dao.getClass().getInterfaces();
//        System.out.println(Arrays.toString(interfaces));
        int r=dao.add(new User(1002,"马德华","1234"));
        System.out.println(r);
        System.out.println(">>>>>>>>>>>>>>>>");
        User u2=new User(-100,"老吴","123");
        int u = dao.update(u2);
        System.out.println(">>>>>>>>>"+u);
    }
}
